package com.yeyks.consumer.dal.dao;

import com.yeyks.consumer.dal.domain.UserAccountOverview;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeyks.consumer.param.UserAccountOverview.UserAccountOverviewInvitedUserListParam;
import com.yeyks.consumer.vo.UserAccountOverviewInvitedUserListVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户账户总览表 Mapper 接口
 * </p>
 *
 * @author yun
 * @since 2019-06-25
 */
public interface UserAccountOverviewMapper extends BaseMapper<UserAccountOverview> {
    int deleteByPrimaryKey(Long id);

    int insertSelective(UserAccountOverview record);

    UserAccountOverview selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UserAccountOverview record);

    int updateByPrimaryKey(UserAccountOverview record);

    /**
     * 查询用户的余额
     *
     * @param userId
     * @return
     */
    UserAccountOverview selectByUserId(@Param("userId") Integer userId);

    UserAccountOverview selectByUserIdAndType(@Param("userId") Integer userId,
                                              @Param("amountType") Integer amountType);

    List<UserAccountOverviewInvitedUserListVo> invitedUserList(UserAccountOverviewInvitedUserListParam param);

}
